package com.bdqn.mapper;

import com.bdqn.pojo.SysUser;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * SysUserMapper实现类(通过SqlSessionTemplate操作数据库)
 */
public class SysUserMapperImpl implements SysUserMapper{
    //myBatis-spring包中提供的实现了SqlSession接口的类,用来操作数据库
    private SqlSessionTemplate sqlSession;

    /**
     * 查询列表
     * @param sysUser
     * @return
     */
    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).selectSysUserList(sysUser);
    }

    @Override
    public int add(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).add(sysUser);
    }

    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession=sqlSession;
    }


}
